/**
 * Created by Administrator on 2016/10/27.
 */
   var sortApp=angular.module('sortApp',['ng-sortable']);
    sortApp.controller("sortController",['$scope',function ($scope) {
        $scope.showResource=true;
        $scope.add=function(){
            $scope.showResource=false;
            alert("添加成功！");
        };
        var multi=document.getElementById("multiply");
        Sortable.create(multi, {
            animation: 150,
            draggable: '.tile',
            handle: '.tile__name',
        });

        [].forEach.call(multi.getElementsByClassName('tile__list'), function (el){
            Sortable.create(el, {
                group: 'resource',
                animation: 150,
                filter: '.js-remove',
                onFilter: function (evt) {
                    evt.item.parentNode.removeChild(evt.item);
                }
            });
        });
    }]);
